Clean code#16841
Clean code#16841magento-engcom-team merged 5 commits intomagento:2.2-developfrom GraysonChiang:2.2-develop
Conversation
|
Hi @GraysonChiang. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
|
Hi @ihor-sviziev, thank you for the review. |
|
@GraysonChiang thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
| protected function getAttribute($name) | ||
| { | ||
| return isset($this->attributes[$name]) ? $this->attributes[$name] : null; | ||
| return $this->attributes[$name]?? : null; |
There was a problem hiding this comment.
- Please add space there before
?? - Looks like there should not be
:
|
Sor, I fixed it and commit that again. |
| protected function _getParam($params, $paramName, $defaultValue = null) | ||
| { | ||
| return isset($params[$paramName]) ? $params[$paramName] : $defaultValue; | ||
| return $params[$paramName]?? $defaultValue; |
There was a problem hiding this comment.
Please add space before ??
| protected function getTypeValue($type) | ||
| { | ||
| return isset($this->typeMapping[$type]) ? $this->typeMapping[$type] : self::VALUE_DYNAMIC; | ||
| return $this->typeMapping[$type]?? self::VALUE_DYNAMIC; |
There was a problem hiding this comment.
- Please add space before
?? - Remove 2nd space after
??
| { | ||
| $method = strtolower($method); | ||
| return isset($this->_handlers[$method]) ? $this->_handlers[$method] : []; | ||
| return $this->_handlers[$method] ?? : []; |
There was a problem hiding this comment.
Please remove : (and space hear it)
| ]; | ||
|
|
||
| return isset($optionGroupsToTypes[$type]) ? $optionGroupsToTypes[$type] : ''; | ||
| return $optionGroupsToTypes[$type] ?? : ''; |
There was a problem hiding this comment.
please remove : (and space near it)
| 'neq' => 'nin' | ||
| ]; | ||
| return isset($conditionsMap[$conditionType]) ? $conditionsMap[$conditionType] : $conditionType; | ||
| return $conditionsMap[$conditionType] ?? $conditionType; |
There was a problem hiding this comment.
please remove 2nd space after ??
| protected function getFilterType($frontendInput) | ||
| { | ||
| return isset($this->filterMap[$frontendInput]) ? $this->filterMap[$frontendInput] : $this->filterMap['default']; | ||
| return $this->filterMap[$frontendInput] ?? $this->filterMap['default']; |
There was a problem hiding this comment.
please remove 2nd space after ??
| return null; | ||
| } | ||
| return isset($fieldsets[$name]) ? $fieldsets[$name] : null; | ||
| return $fieldsets[$name] ?? null; |
There was a problem hiding this comment.
Please remove 2nd space after ??
| private function getArrayValueByKey($key, array $array) | ||
| { | ||
| return isset($array[$key]) ? $array[$key] : []; | ||
| return $array[$key] ?? []; |
There was a problem hiding this comment.
Please remove 2nd space after ??
|
I fixed. |
|
Hi @ihor-sviziev, thank you for the review. |
|
Hi @GraysonChiang. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Description
Just modify some code, and make it Cleaner more...